﻿@model mtm.Core.Models.DetailsUserModel
@{ 
    /* Copyright © 2009 - 2010 Oleg Stuhin & Rostislav Haitovich 
       To learn more about mytrip.mvc visit  
       http://mytripmvc.net  http://mytripmvc.codeplex.com 
       mytripmvc@gmail.com
       license: Microsoft Public License (Ms-PL) */ 
}
@{
    ViewBag.Title = Html.MytripPageTitle(Model.UserName, "/");
    ViewBag.Keywords=Html.MytripPageTitle(Model.UserName, ",");
    ViewBag.Description=Html.MytripPageTitle(Model.UserName, ",");
}
@section scriptlink{
@Html.ScriptLink("jquery.validate.min.js,jquery.validate.unobtrusive.min.js")
}
@section content{
<h1 class="title">@Html.Encode(Model.UserName)</h1>
<table>
<tr>
<th class="oneinput">
<h2 class="white">@CoreLanguage.account_information</h2>
</th><th></th></tr>
<tr><th class="oneinput">
@CoreLanguage.Email
</th><td>
@Html.Encode(Model.Email)
</td></tr><tr>
<th class="oneinput">
@CoreLanguage.LastActivityDate
</th><td>
@Html.Encode(string.Format("{0:g}", Model.LastActivityDate))
</td></tr><tr>
<th class="oneinput">
@CoreLanguage.CreationDate
</th><td>
@Html.Encode(string.Format("{0:g}", Model.CreationDate))
</td></tr><tr>
<th class="oneinput">
@CoreLanguage.LastLoginDate
</th><td>
@Html.Encode(string.Format("{0:g}", Model.LastLoginDate))
</td></tr><tr>
<th class="oneinput">
@CoreLanguage.LastPasswordChangedDate
</th><td>
@Html.Encode(string.Format("{0:g}", Model.LastPasswordChangedDate)) 
</td></tr><tr>
<th class="oneinput">
@CoreLanguage.UserIP
</th><td>
@Html.Encode(Model.UserIP) 
</td></tr><tr>
<th class="oneinput">
@CoreLanguage.IsApproved
</th><td>
@if (Model.IsApproved){
@CoreLanguage.user_is_approved
@Html.MytripImage("/images/approved.png", CoreLanguage.user_is_approved, 15, 0, 0)
<span>[</span>
@Html.MytripImageLink(Url.Action("IsApproved", new { id = Model.UserName }),"/images/noapproved.png", CoreLanguage.user_is_not_approved, 15, 0, 0)
<span>]</span>
}else{
@CoreLanguage.user_is_not_approved
@Html.MytripImage("/images/noapproved.png", CoreLanguage.user_is_not_approved, 15, 0, 0)
<span>[</span>
@Html.MytripImageLink(Url.Action("IsApproved", new { id = Model.UserName }),"/images/approved.png", CoreLanguage.user_is_approved, 15, 0, 0)
<span>]</span>
} 
</td></tr><tr>
<th class="oneinput">
<h2 class="white">@CoreLanguage.role_information</h2>
</th>
 
@using (Html.BeginForm()){
<th>
<div><div class="textboxR">
@Html.ValidationMessageFor(m => m.RoleName)
</div></div><br />
@Html.MytripButton(CoreLanguage.add_user_to_role,true,"right")
<div class="textboxR">
@Html.DropDownListFor(m => m.RoleName, Model.AllRoles, CoreLanguage.choose_role)
</div></th>
}
</tr>
@foreach (string item in Model.RolesInUser){
<tr><th class="oneinput">
@item
</th><td>
@CoreLanguage.user_in_role
@Html.MytripImage("/images/approved.png", CoreLanguage.user_in_role, 15, 0, 0)
<span>[</span>
@Html.MytripImageLink(Url.Action("IsUserInRole", new { id = Model.UserName, id2 = item }),
                                        "/images/noapproved.png", "delete", 15, 0, 0)
<span>]</span>
</td></tr>
}
</table>
<div class="button">
@Html.MytripButton("/Users/Index", CoreLanguage.back_to_list, true,"left")
</div>
}

